/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.restaurant.domain;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author root
 */
@Entity
@Table(name = "employeeattendace")
@XmlRootElement(name = "employeeattendace")
@NamedQueries({
    @NamedQuery(name = "Employeeattendace.findAll", query = "SELECT e FROM Employeeattendace e"),
    @NamedQuery(name = "Employeeattendace.findByEmployeeattendaceID", query = "SELECT e FROM Employeeattendace e WHERE e.employeeattendaceID = :employeeattendaceID"),
    @NamedQuery(name = "Employeeattendace.findByDatetime", query = "SELECT e FROM Employeeattendace e WHERE e.datetime = :datetime"),
    @NamedQuery(name = "Employeeattendace.findByIspresent", query = "SELECT e FROM Employeeattendace e WHERE e.ispresent = :ispresent")})
public class Employeeattendace implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "EmployeeattendaceID")
    private Long employeeattendaceID;
    @Column(name = "datetime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datetime;
    @Column(name = "ispresent")
    private Short ispresent;
    @JoinColumn(name = "employee_EmployeeID", referencedColumnName = "EmployeeID")
    @ManyToOne(optional = false)
    private Employee employee;

    public Employeeattendace() {
    }

    public Employeeattendace(Long employeeattendaceID) {
        this.employeeattendaceID = employeeattendaceID;
    }

    public Long getEmployeeattendaceID() {
        return employeeattendaceID;
    }

    public void setEmployeeattendaceID(Long employeeattendaceID) {
        this.employeeattendaceID = employeeattendaceID;
    }

    public Date getDatetime() {
        return datetime;
    }

    public void setDatetime(Date datetime) {
        this.datetime = datetime;
    }

    public Short getIspresent() {
        return ispresent;
    }

    public void setIspresent(Short ispresent) {
        this.ispresent = ispresent;
    }

    public Employee getEmployee() {
        return employee;
    }

    public void setEmployee(Employee employee) {
        this.employee = employee;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (employeeattendaceID != null ? employeeattendaceID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Employeeattendace)) {
            return false;
        }
        Employeeattendace other = (Employeeattendace) object;
        if ((this.employeeattendaceID == null && other.employeeattendaceID != null) || (this.employeeattendaceID != null && !this.employeeattendaceID.equals(other.employeeattendaceID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.restaurant.domain.Employeeattendace[employeeattendaceID=" + employeeattendaceID + "]";
    }

}
